package com.atguigu.study.bootredis.study;

import com.atguigu.study.bootredis.consts.PizzaDeliverySystemConfiguration;

/**
 * @author jiangta
 * @version 1.0
 * @date 2020/12/14 9:54 上午
 */
public class Pizza {
    public enum TestColor {
        RED,
        BLUE,
        GREEN;
    }
    public enum PizzaStatus {
        ORDERED,
        READY,
        DELIVERED;
    }
    private PizzaStatus status;

    public PizzaStatus getStatus() {
        return status;
    }

    public void setStatus(PizzaStatus status) {
        this.status = status;
    }

    public boolean isDeliverable() {
        return getStatus() == PizzaStatus.READY;
    }

    public void deliver() {
        if(isDeliverable()) {
            PizzaDeliverySystemConfiguration.getInstance().getDeliveryStrategy().deliver(this);
            this.setStatus(PizzaStatus.DELIVERED);
        }
    }

    public static void main(String[] args) {
        Pizza testPz = new Pizza();
        if(testPz.getStatus().equals(TestColor.GREEN)) {

        }
//        if(testPz.getStatus() == TestColor.GREEN){
//
//        }
    }

}
